import Foundation
@objc public enum FYResultCode: Int, ConvertibleEnum {
    case success = 200
    case userInvalid = 2002001
    case tokenExpire = 2000001
    case tokenInvalid = 2000002
    case needUpdate = 2009006
    case timeOut = 500
    case other = -1
}
@objc public protocol FYBaseModelProtocol {
    @objc optional func sheetActionTitle() -> String
}
@objcMembers
open class FYBaseModel: Convertible, FYBaseModelProtocol {
    public var resultCode: FYResultCode = .other
    public var resultMsg: String = ""
    var timestamp: Int = 0
    public func success() -> Bool {
        return self.resultCode == .success
    }
    required public init() {}
    public func kj_didConvertToModel(from json: [String : Any]) {}
    @objc public func sheetActionTitle() -> String {
        return ""
    }
}
@objc public enum FYUserStatus: Int, ConvertibleEnum {
    case unknown = 0
    case needKyc = 10
    case toBeApply = 20
    case dataCapture = 30
    case toBeWithdraw = 32
    case modifyBankCard = 41
    case pending = 50
    case reject = 51
    case payout = 70
    case repayment = 80
    case dueToDate = 81
    public var nextAction: Bool {
        switch self {
        case .needKyc, .dataCapture, .toBeWithdraw, .modifyBankCard, .repayment, .dueToDate:
            return true
        default: return false
        }
    }
}
@objc public enum FYOrderStatus: Int, ConvertibleEnum {
    case unknown = 0
    case dataCaptrue = 10
    case underReview = 30
    case reject = 31
    case withdraw = 32
    case changeBank = 36
    case processing = 50
    case repayment = 60
    case due = 61
    case payoff = 70
    case cancel = 99
    public var statusMessage: String {
        switch self {
        case .dataCaptrue:
            return "Unfinished Application"
        case .underReview:
            return "Under review"
        case .reject:
            return "Reject"
        case .withdraw:
            return "To be withdrawn"
        case .changeBank:
            return "Change bank account"
        case .processing:
            return "Loan processing"
        case .repayment:
            return "Repayment"
        case .due:
            return "Overdue"
        case .payoff:
            return "Pay off"
        case .cancel:
            return "Cancel"
        default: return ""
        }
    }
    public var buttonTitle: String {
        switch self {
        case .dataCaptrue:
            return "Continue submitting"
        case .withdraw:
            return "Withdrawn"
        case .changeBank:
            return "Change bank account"
        case .repayment:
            return "Repayment"
        case .due:
            return "Repayment"
        default: return ""
        }
    }
    public var detailRemind: String {
        switch self {
        case .dataCaptrue:
            return "Please submit complete information. In this case we will deal with your application in a shorter time."
        case .underReview:
            return "In the loan processing, the final approved amount depends on your credit assessment. Maintaining a good credit record can increase the approved loan amount."
        case .reject:
            return "Your loan application has been rejected."
        case .withdraw:
            return "You have a pending withdrawal order, and we need your confirmation. Once confirmed, we will transfer the funds to your bank account immediately."
        case .changeBank:
            return "Your bank card information is unable to receive the loan. Please update it promptly to ensure timely disbursement."
        case .processing:
            return "Your loan application has been approved. The loan will be disbursed to your account shortly. Please keep an eye on your account."
        case .repayment:
            return "Please repay on time according to the repayment date provided by the system. Maintaining good credit will continue to increase your loan limit."
        case .due:
            return "This order has not been settled on time and is now accruing late fees. Please repay as soon as possible to avoid additional charges."
        case .payoff:
            return "This order has been successfully settled. You can now apply for a new loan with a higher amount."
        case .cancel:
            return "The order has been canceled. If you need to reorder or have any questions, please contact us."
        default: return ""
        }
    }
    public var showOperation: Bool {
        switch self {
        case .changeBank, .repayment, .due, .dataCaptrue:
            return true
        default: return false
        }
    }
    public var waitRepayment: Bool {
        switch self {
        case .repayment, .payoff, .due: return true
        default: return false
        }
    }
}
@objc public enum FYKycInitItemType: Int, ConvertibleEnum {
    case unknown = 0
    case inputbox = 1
    case option = 2
    case downMenu = 3
    case keyValue = 4
    case image = 5
}
public enum FYKycIdentifier: String, ConvertibleEnum {
    case unknown = "unknown"
    case identity = "identity"
    case liveness = "liveness"
    case pay_account = "pay_account"
    case personal = "personal"
    case questionnaire = "questionnaire"
    case tax = "tax"
    case urgent_contact = "urgent_contact"
    case work = "work"
    public var navigationTitle: String {
        switch self {
        case .unknown:
            return ""
        case .liveness:
            return "Face identification"
        case .identity:
            return "Aadhaar"
        case .personal:
            return "Personal Information"
        case .work:
            return "Work information"
        case .urgent_contact:
            return "Emergency Contact"
        case .pay_account:
            return "Bank Information"
        case .tax:
            return "PAN"
        case .questionnaire:
            return "Credit standing"
        }
    }
}
